package com.jsgt.greekfire.ui.home.menu.powerise

import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.jsgt.greekfire.R
import com.jsgt.greekfire.bean.PrivilegeBean

class PrivilegeAdapter : BaseQuickAdapter<PrivilegeBean, BaseViewHolder>(
    R.layout.item_privilege
) {
    private val poweriseList = mutableListOf(
        "特权一", "特权二", "特权三", "特权四", "特权五", "特权六",
        "特权七", "特权八", "特权九", "特权十", "特权十一", "特权十二",
        "特权十三", "特权十四", "特权十五", "特权十六", "特权十七",
        "特权十八", "特权十九", "特权二十"
    )

    override fun convert(holder: BaseViewHolder, item: PrivilegeBean) {
        holder.setText(R.id.txv, poweriseList[holder.adapterPosition] + "：" + item.content)
    }

    override fun getItemCount(): Int {
        return super.getItemCount().coerceAtMost(poweriseList.size)
    }
}